home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / PC Card SDKs / PC Card Manager 2.0 SDK / Software / CRM Sample / SerialPortUtilities / SerialPortUtilities.h < prev   
Encoding:
C/C++ Source or Header  |  1997-06-05  |  1.6 KB  |  53 lines  |  [TEXT/CWIE]

  1. /*
  2.      File:        SerialPortUtilities.h
  3.  
  4.      Contains:    Useful utility functions for dealing with serial ports registered
  5.                  with the Communications Resource Manager (CRM).
  6.                  
  7.                  PC Card modems, PowerBook Internal modems, and NuBus Serial port
  8.                  are the most common types of these serial devices.
  9.  
  10.                 A single function called:
  11.  
  12.                     void    ForEachSerialPort(SerialPortActionProcPtr actionProc,void * param);
  13.  
  14.                 allows you to record information about available serial ports. Your
  15.                 “actionProc” is called once for every serial port in the system and
  16.                 is passed the CRMSerialPtr for the corresponding device.
  17.                 
  18.                 We use this function as a building block for:
  19.  
  20.                     void    AddSerialPortsToMenu(MenuRef serialPortMenu);
  21.  
  22.                 which is very useful for building a popup or other menu from which
  23.                 the user can select an available serial port.
  24.  
  25.  
  26.                 Once you have a port name (either selected by the user or stored
  27.                 in a preferences file), you must get obtain the CRMSerialPtr in
  28.                 order to get the driver information and/or icon for a port. For
  29.                 this purpose, we include:
  30.  
  31.                     CRMSerialPtr    GetCRMSerialPtrForPort(StringPtr portName);
  32.  */
  33.  
  34. #ifndef        _APPLE_SERIALPORTUTILITIES_
  35. #define        _APPLE_SERIALPORTUTILITIES_
  36.  
  37. #ifndef        __CRMSERIALDEVICES__
  38. #include    <CRMSerialDevices.h>
  39. #endif
  40.  
  41. #ifndef        __MENUS__
  42. #include    <Menus.h>
  43. #endif
  44.  
  45.  
  46. typedef    void    (*SerialPortActionProcPtr)(CRMSerialPtr serialPortInfo,void * param);
  47. void            ForEachSerialPort(SerialPortActionProcPtr actionProc,void * param);
  48. CRMSerialPtr    GetCRMSerialPtrForPort(StringPtr portName);
  49.  
  50. void            AddSerialPortsToMenu(MenuRef serialPortMenu);
  51.  
  52. #endif
  53.